<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>首页</title>
    {% block style %}{% endblock %}
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <nav style="margin:0;" class="navbar navbar-inverse" role="navigation">
        <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target="#example-navbar-collapse">
                <span class="sr-only">切换导航</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">后台管理</a>
        </div>
        <div class="collapse navbar-collapse" id="example-navbar-collapse">
            <ul class="nav navbar-nav">
                {% if state %}
                <li><a href="/teachers">教师管理</a></li>
                <li class="active"><a href="/course/{{id}}">课程管理</a></li>
                {% else %}
                <li><a href="#">教师管理</a></li>
                <li class="active"><a href="#">课程管理</a></li>
                {% endif %}
            </ul>
            <ul class="nav navbar-nav navbar-right">
                {% if state %}
                <li><a href="/logout"><span class="glyphicon glyphicon-user"></span> 注销</a></li>
                <li><a href="#"><span class="glyphicon glyphicon-user"></span> {{name}}</a></li>
                {% else %}
                <li><a href="/register"><span class="glyphicon glyphicon-user"></span> 注册</a></li>
                <li><a href="/login"><span class="glyphicon glyphicon-user"></span> 登录</a></li>
                {% endif %}
            </ul>
        </div>
        </div>
    </nav>
    {% block content%}
    <div class="container">
        <h1>美丽的主页面</h1>
    </div>
    {% endblock %}





    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>

    {% block script %}{% endblock %}
</body>
</html>